<layout name="Common/layout" />

<link rel="stylesheet" href="__PUBLIC__/Home/style/order.css" type="text/css">
<link rel="stylesheet" href="__PUBLIC__/Home/style/home.css" type="text/css">

<script type="text/javascript" src="__PUBLIC__/Home/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Home/js/home.js"></script>
<style type="text/css">
    .alipaysubmit{
        margin: 10px auto;
        width: 150px;
    }
    .alipaysubmit a{
        cursor: pointer;
        padding: 5px;
        background: skyblue;
        color: #FFF;
        font-weight: bold;
        font-size: 20px;
        border: 0;
    }
</style>
<!-- 页面主体 start -->
<div class="main w1210 bc mt10">
    <div class="crumb w1210">
        <h2><strong>订单中心 </strong><span>> 我的订单</span>> 订单号：<?php echo $order['order_sn'];?></h2>
    </div>

    <!-- 左侧导航菜单 start -->
    <include file="My/menu"/>
    <!-- 左侧导航菜单 end -->

    <!-- 右侧内容区域 start -->
    <div class="content fl ml10">
        <div class="order_hd">
            <h3>订单号：<?php echo $order['order_sn'];?></h3>
        </div>

        <div class="order_bd mt10">
            <table class="orders">
                <thead>
                <tr>
                    <th>商品名称</th>
                    <th>商品图片</th>
                    <th>商品规格</th>
                    <th>商品数量</th>
                    <th>商品单价</th>
                </tr>
                </thead>
                <tbody>
                    <?php foreach($order['goods_list'] as $k=>$v):?>
                    <tr>
                        <td><?php echo $v['goods_name'];?></td>
                        <td><img src="<?php echo showImg($v.sm_logo,'goods/','logo/');?>"/> </td>
                        <td>
                            <?php foreach($v['gdDara'] as $k1=>$v1):?>
                                <p><?php echo $v1['attr_name'];?>:<?php echo $v1['attr_value'];?></p>
                            <?php endforeach;?>
                        </td>
                        <td><?php echo $v['goods_number'];?></td>
                        <td><?php echo $v['price'];?></td>
                    </tr>
                    <?php endforeach;?>
                </tbody>
            </table>
            <br/>
            <table class="orders">
                <tbody>
                    <tr>
                        <td colspan="<?php if($order['post_status']==1):?>5<?php else:?>6<?php endif;?>">
                            <span>收货人：<?php echo $order['shr_name'];?>，</span>
                            <span style="margin-left: 20px;">收货电话：<?php echo $order['shr_tel'];?>，</span>
                            <span style="margin-left: 20px;">收货地址：<?php echo $order['shr_province'];?> <?php echo $order['shr_city'];?>
                                <?php echo $order['shr_area'];?> <?php echo $order['shr_address'];?>，</span>
                            <span style="margin-left: 20px;">快递单号：<?php echo $order['post_number'];?></span>
                        </td>
                        <?php if($order['post_status'] == 1):?>
                        <td>
                            <p class="alipaysubmit">
                            <a href="<?php echo U('My/setReceived', array('id'=>$order['id']));?>"
                               onclick="if(confirm('您要确认收货？')){return true;}else{return false;}">确认收货</a>
                            </p>
                        </td>
                        <?php endif;?>
                    </tr>
                    <tr>
                        <td colspan="4">
                            订单总价：<span style="font-size: 20px;color: red;"><?php echo $order['total_price'];?></span>，
                            下单时间：<?php echo date('Y-m-d H:i:s', $order['addtime']);?>
                        </td>
                        <td width="10%">
                            <?php if($order['order_status']=='正常'):?>
                                <?php if($order['pay_status']=='是'):?>
                                    <?php echo $order['post_status']==1 ? '已发货' : ($order['post_status'] == 2 ? '已签收' : '未发货');?>
                                <?php else:?>
                                    <p class="alipaysubmit"><!--<?php echo makeAlipayBtn($order['id']); ?>-->
                                    未付款</p>
                                <?php endif;?>
                            <?php else:?>
                                已取消
                            <?php endif;?>
                        </td>
                        <td width="5%"><a href="<?php echo U('My/order');?>">返回</a></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <!-- 右侧内容区域 end -->
</div>
<!-- 页面主体 end-->